@extends('Admin/index/index')
@section('content')
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">商品添加</h1>
    <div class="col-lg-6 col-lg-offset-3">
        @if(session('error'))
            
            {{session('error')}}

        @endif

        @if (count($errors) > 0)
            <div class="alert alert-danger">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        <form role="form" action="{{url('admin/goods/insert')}}" method="post" enctype="multipart/form-data">
            <div class="form-group">
                <label>选择分类</label>
                <select name="cid" class="form-control">
                        <option value="0">顶级分类</option>
                        @foreach($cate as $k=>$v)
                            <option value="{{$v->id}}">{{$v->name}}</option>
                        @endforeach
                </select>
            </div>
            <div class="form-group">
                <label>商品标题</label>
                <input class="form-control" type="text" name="title" value="{{old('title')}}">
                <p class="help-block"></p>
            </div>
            <div class="form-group">
                <label>价格</label>
                <input class="form-control"  type="text" name="price" value="{{old('price')}}">
                <p class="help-block"></p>
            </div>
            <div class="form-group">
                <label>图片</label>
                <input  type="file" name="pic">
                <p class="help-block"></p>
            </div>
            <div class="form-group">
                <label>URL地址</label>
                <input class="form-control" type="text" name="url" value="{{old('url')}}">
                <p class="help-block"></p>
            </div>
            {{csrf_field()}}
            <center>
            <button class="btn btn-primary" type="submit">添加商品</button>
            <button type="reset" class="btn btn-info">重置</button>
            <center>
        </form>
    </div>
</div>
</div>
</div>
@endsection